<!DOCTYPE html>
<html lang="en">
<!-- start: HEAD -->
<head>

    <title>四川省学生资助管理系统</title>


    <!-- start: META -->
    <meta charset="utf-8"/>
    <meta http-equiv='X-UA-Compatible' content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta content="" name="description"/>
    <meta content="" name="author"/>
    <!-- end: META -->
    <link rel="shortcut icon" type="image/x-icon" href="resources/images/favicon.ico"/>
    <link rel="stylesheet" href="resources/css/fonts-useso/fonts.css">
    <!-- str: 主要css -->


    <!-- bootstrap 及 bootstrap拓展 -->
    <link rel="stylesheet" href="resources/plugins/bootstrap-3.3.5-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="resources/plugins/bootstrap-3.3.5-dist/css/bootstrap-expand.css">
    <!-- end: 主要css -->
    <!-- start: 插件 css -->


    <!-- bootstrap 摸态框 -->
    <link rel="stylesheet" href="resources/plugins/bootstrap-modal/css/bootstrap-modal.css">
    <link rel="stylesheet" href="resources/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css">


    <!-- Font Awesome 图标字体 -->
    <link rel="stylesheet" href="resources/plugins/font-awesome/css/font-awesome.min.css">


    <!-- iCheck 多选/单选插件 -->
    <link rel="stylesheet" href="resources/plugins/iCheck/skins/all.css">
    <!-- magic-input 多选/单选插件 -->
    <link rel="stylesheet" href="resources/plugins/magic-input/dist/magic-input.min.css">


    <!-- perfect-scrollbar 自定义滚动条 -->
    <link rel="stylesheet" href="resources/plugins/perfect-scrollbar/src/perfect-scrollbar.css">


    <!-- animate css3动画 -->
    <link rel="stylesheet" href="resources/plugins/animate.css/animate.min.css">


    <!-- animate css3动画 -->
    <link rel="stylesheet" href="resources/plugins/select2-master/dist/css/select2.min.css">
    <link rel="stylesheet" href="resources/plugins/select2-bootstrap/dist/select2-bootstrap.css">


    <!-- 表单验证 -->
    <link rel="stylesheet"
          href="resources/plugins/jQuery-Validation-Engine-master/css/validationEngine.jquery.css">


    <!-- 日期插件 -->
    <link rel="stylesheet"
          href="resources/plugins/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css">


    <!-- sweetalert 弹出框 -->

    <link rel="stylesheet" href="resources/plugins/sweetalert-0.5.x/lib/sweet-alert.css">


    <!-- ztree -->
    <link rel="stylesheet" href="resources/plugins/zTree_v3/css/zTreeStyle/zTreeStyle.css">


    <!--[if lt IE 10]>
    <link rel="stylesheet" href="resources/plugins/uploadify/uploadify.css"/>
    <![endif]-->
    <!--[if gte IE 10]><!-->
    <link rel="stylesheet" href="resources/plugins/uploadifive/uploadifive.css"/>
    <!--<![endif]-->
    <!-- end: 插件 css -->


    <!-- start: 框架 css -->
    <link rel="stylesheet" href="resources/css/styles.css">
    <link rel="stylesheet" href="resources/css/styles-responsive.css">
    <link rel="stylesheet" href="resources/css/plugins.css">
    <link rel="stylesheet" href="resources/css/themes/theme-default.css" type="text/css" id="skin_color">
    <link rel="stylesheet" href="resources/css/print.css" type="text/css" media="print"/>
    <link rel="stylesheet" href="resources/css/quick-layout.css">
    <!-- end: 框架 css -->
    <!--[if lt IE 9]>
    <script src="resources/plugins/jQuery/jquery-1.11.1.min.js"></script>
    <script src="resources/plugins/respond.min.js"></script>
    <script src="resources/plugins/excanvas.min.js"></script>
    <link rel="stylesheet" href="resources/css/ie8-patch.css">
    <![endif]-->
    <!--[if lt IE 10]>
    <link rel="stylesheet" href="resources/css/ie9-patch.css">
    <![endif]-->
    <!--[if gte IE 9]><!-->
    <script src="resources/plugins/jQuery/jquery-2.1.1.min.js"></script>
    <!--<![endif]-->


    <script>
        var basePath = 'https://www.scxszz.com:443';
        var nodePath = 'https://www.scxszz.com:443';
        var stageMenu = true;//分阶段菜单
        var tabModel = true;//是否启用Tab页
    </script>
</head>
<!-- start: body -->
<body class="single-page">
<div class="tabModel-content animated hide">
    <div class="col-md-10 col-md-offset-1">
        <h3 data-localize="frame_xtgl.mmxg_mmxg">密码修改</h3>
        <hr>
        <form class="form-horizontal" data-action="https://www.scxszz.com:443/s/id/idUser/savePwd">
            <input type="hidden" id="is_change" value="0">
            <input type="hidden" id="userid" name="userid" value="16092810154391713426">
            <input type="hidden" id="lastlogin" name="lastlogin" value="2016-10-12 12:29:48">
            <div class="form-group">
                <label class="control-label col-sm-3">
                    <font data-localize="frame_xtgl.mmxg_yhm"><b>用户名</b></font>：
                </label>

                <span class="control-value col-sm-9">
                    chengongsuo
                </span>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-3">
                    <font data-localize="frame_xtgl.mmxg_mm"><b>原密码</b></font>：
                </label>

                <div class="col-sm-4">
                    <input type="text" id="oldpwd" name="oldpwd" class="form-control validate[required]">
                    <span class="symbol required"></span>
                </div>
                <label class="control-label">
                    <font style="color: red;">输入您正在使用的密码，用于确认您的身份！</font>
                </label>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-3">
                    <font data-localize="frame_xtgl.mmxg_mm"><b>新密码</b></font>：
                </label>

                <div class="col-sm-4">
                    <input type="password" id="userpwd" name="userpwd" title="至少要包含数字，英文，特殊字符中的两种，长度6到20位!"
                           class="form-control validate[required,minSize[6],maxSize[20],method[subPage.equalpwd('userpwd')]">
                    <span class="symbol required"></span>
                </div>
                <label class="control-label">
                    <font style="color: red;">输入您要修改的新密码！</font>
                </label>
            </div>

            <div class="form-group">
                <label class="control-label col-sm-3"></label>
                <div class="col-sm-9">
                    <div id="tips">
                        <span></span><span></span><span></span><span></span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-sm-3">
                    <font data-localize="frame_xtgl.mmxg_cxsrmm"><b>确认新密码</b></font>：
                </label>

                <div class="col-sm-4">
                    <input type="password" id="reuserpwd" title="至少要包含数字，英文，特殊字符中的两种，长度6到20位!"
                           class="form-control validate[required,minSize[6],maxSize[20],method[subPage.equalpwd('reuserpwd')]]">
                    <span class="symbol required"></span>
                </div>
                <label class="control-label">
                    <font style="color: red;">请再输入一次新的密码用于确认！</font>
                </label>
            </div>
            <div class="form-group">
                <div class="col-md-offset-3 col-sm-9">
                    <button class="btn btn-green" type="button" onclick="subPage.saveUserInfo(this)">
                        <font data-localize="frame_button.save">保存</font> <i class="fa fa-check"></i>
                    </button>
                </div>
            </div>
        </form>


    </div>


    <!-- start: 必要脚本 -->


    <!-- jquery-ui -->
    <script src="resources/plugins/jquery-ui/jquery-ui-1.10.2.custom.min.js"></script>


    <!-- jquery-ui -->
    <script src="resources/plugins/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>


    <!-- blockUI -->
    <script src="resources/plugins/blockUI/jquery.blockUI.js"></script>


    <!-- 单选/多选 插件 -->
    <script src="resources/plugins/iCheck/jquery.icheck.min.js"></script>


    <!-- 下拉插件 -->
    <script src="resources/plugins/select2-master/dist/js/select2.min.js"></script>


    <!-- jquery.cookie -->
    <script src="resources/plugins/jquery-cookie/jquery.cookie.js"></script>
    <!-- end: 必要脚本 -->
    <!-- 滚动条 -->


    <!-- 滚动条 -->
    <script src="resources/plugins/perfect-scrollbar/src/jquery.mousewheel.js"></script>
    <script src="resources/plugins/perfect-scrollbar/src/perfect-scrollbar.js"></script>
    <!-- 提示框 -->


    <!-- 提示框 -->
    <script src="resources/plugins/bootbox/bootbox.min.js"></script>
    <!-- moment -->


    <!-- 时间工具 -->
    <script src="resources/plugins/moment/min/moment.min.js"></script>
    <script src="resources/plugins/moment/locale/zh-cn.js"></script>
    <!-- 表单验证 -->


    <!-- 表单验证 -->
    <script src="resources/plugins/jQuery-Validation-Engine-master/js/jquery.validationEngine.js"></script>
    <script>
        function getCookie(name)//取cookies函数     
        {
            var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
            if (arr != null) return unescape(arr[2]);
            return null;
        }

        try {
            if (getCookie('jdLanguage') == 'en') {
                document.write('<scr' + 'ipt src="resources/plugins/jQuery-Validation-Engine-master/js/languages/jquery.validationEngine-en.js"></scr' + 'ipt>');
            } else {
                document.write('<scr' + 'ipt src="resources/plugins/jQuery-Validation-Engine-master/js/languages/jquery.validationEngine-zh_CN.js"></scr' + 'ipt>');
            }
        } catch (e) {
            document.write('<scr' + 'ipt src="resources/plugins/jQuery-Validation-Engine-master/js/languages/jquery.validationEngine-zh_CN.js"></scr' + 'ipt>');
        }

    </script>
    <!-- 日期插件 -->


    <!-- 日期插件 -->
    <script src="resources/plugins/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
    <!-- ztree -->


    <!-- ztree -->
    <script type="text/javascript" src="resources/plugins/zTree_v3/js/jquery.ztree.all-3.5.min.js"></script>
    <!-- 移动端 -->


    <!-- jquery.touchSwipe 手势 -->
    <script src="resources/plugins/TouchSwipe/jquery.touchSwipe.min.js"></script>


    <!-- jquery.velocity 动画插件 -->
    <script src="resources/plugins/velocity/jquery.velocity.min.js"></script>


    <!-- 文件上传 -->
    <!--[if lt IE 10]>
    <script src="resources/plugins/uploadify/jquery.uploadify.min.js"></script>
    <![endif]-->
    <!--[if gte IE 10]><!-->
    <script src="resources/plugins/uploadifive/jquery.uploadifive.min.js"></script>
    <script src="resources/js/content-type.js"></script>
    <!--<![endif]-->
    <!-- 框架 -->


    <!-- start: CORE JAVASCRIPTS -->
    <script src="resources/js/syscode_init.js"></script>
    <script src="resources/js/syscode.js"></script>
    <script src="resources/js/main.js"></script>
    <script src="resources/js/frame-tool-tab-model.js"></script>
    <script src="resources/js/language.js"></script>
    <!-- end: CORE JAVASCRIPTS -->
    <script>
        tool.userloginid = 'chengongsuo';
        tool.usertype = '1, 2, 3, 4, 5';
        tool.group = '15122910383306910022,';
        $(document).ready(function () {
            if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
                var ieversion = new Number(RegExp.$1);
                if (ieversion == 8) {
                    isIE8 = true;
                    $body.addClass('isIE8');
                } else if (ieversion == 9) {
                    isIE9 = true;
                    $body.addClass('isIE9');
                }
            }
            if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
                isMobile = true;
                $body.addClass('isMobile');
            }
            $('.form-horizontal').each(function () {
                var $form = $(this);
                if (isBlank($form.attr('data-action'))) {
                    $form.attr('data-action', window.location.href);
                    if (window.location.href.indexOf("action") < 0) {//spring mvc
                        $form.find("#yspager_currentPageno").attr("name", "currentPageno");
                        $form.find("#eachPageRows").attr("name", "eachPageRows");
                    }
                }
            });
            $('.tabModel-content').removeClass('hide').addClass("fadeInUp").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
                $(this).removeClass("fadeInUp");
            });
            Main.initTabModel();
        });
    </script>
    <!-- 动画滚动 -->

    <!-- ScrollToFixed -->


</div>
</body>
<!-- end: BODY -->
</html>


<script>
    var deltitle = '';
    var errtip = '';

    function getCookie(name)//取cookies函数
    {
        var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
        if (arr != null) return unescape(arr[2]);
        return null;
    }

    var cookielang = getCookie("jdLanguage");
    if (cookielang == "en") {
        deltitle = 'Passwords are not consistent';
        errtip = 'Operation failed, please try again!';
    } else {
        deltitle = '2次输入密码不一致';
        errtip = '操作失败,请重试!';
    }
    subPage = {
        equalpwd: function (id) {
            if (checkStrong(document.getElementById(id).value) < 2) {
                return "密码强度过低，至少要包含数字，英文，特殊字符中的两种，长度6到20位!";
            }
            var userpwd = $('#userpwd').val();
            var reuserpwd = $('#reuserpwd').val();
            if (userpwd != null && userpwd != '' && reuserpwd != null && reuserpwd != '' && userpwd != reuserpwd) {
                return deltitle;
            }
            if (userpwd == reuserpwd) {
                if (id == 'userpwd' && $('#reuserpwd').parent().find('div').hasClass('formError')) {
                    $('#reuserpwd').parent().find('div.formError').remove();
                } else if ($('#userpwd').parent().find('div').hasClass('formError')) {
                    $('#userpwd').parent().find('div.formError').remove();
                }
            }
            return '';
        },
        saveUserInfo: function (el) {
            var form_element = $(el).parents(".form-horizontal");
            if (form_element.validationEngine('validate')) {
                $.ajax({
                    url: tool.initParams(form_element.attr("data-action")),
                    cache: false,
                    type: "post",
                    data: form_element.serialize(),
                    timeout: 1000 * 10,
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        tool.alertWarning(errtip);
                    },
                    success: function (data) {
                        data = eval('(' + data + ')');
                        if (data.oper_res) {
                            tool.alertSuccess(data.oper_msg);
                            parent.closePass();
                        } else {
                            tool.alertWarning(data.oper_msg);
                        }
                    }
                });
            }
        }
    }


    $(document).ready(function () {
        var pwd = '';
        if (pwd != null && pwd != '') {
            parent.document.getElementById('pwd').value = pwd;
        }
        var oTips = document.getElementById("tips");
        var oInput = document.getElementById("userpwd");
        var aSpan = oTips.getElementsByTagName("span");
        var aStr = ["弱", "中", "强", "非常好"];
        var i = 0;
        oInput.onkeyup = oInput.onfocus = oInput.onblur = function () {
            var index = checkStrong(this.value);
            //this.className = index ? "form-control " : "form-control ";
            oTips.className = "s" + index;
            for (i = 0; i < aSpan.length; i++)
                aSpan[i].className = aSpan[i].innerHTML = "";
            if (index == 4) {
                index && (aSpan[index - 1].className = "active", aSpan[index - 1].innerHTML = aStr[index - 1]);
                index && (aSpan[index - 2].className = "active", aSpan[index - 2].innerHTML = aStr[index - 2]);
                index && (aSpan[index - 3].className = "active", aSpan[index - 3].innerHTML = aStr[index - 3]);
                index && (aSpan[index - 4].className = "active", aSpan[index - 4].innerHTML = aStr[index - 4]);
            } else if (index == 3) {
                index && (aSpan[index - 1].className = "active", aSpan[index - 1].innerHTML = aStr[index - 1]);
                index && (aSpan[index - 2].className = "active", aSpan[index - 2].innerHTML = aStr[index - 2]);
                index && (aSpan[index - 3].className = "active", aSpan[index - 3].innerHTML = aStr[index - 3]);
            } else if (index == 2) {
                index && (aSpan[index - 1].className = "active", aSpan[index - 1].innerHTML = aStr[index - 1]);
                index && (aSpan[index - 2].className = "active", aSpan[index - 2].innerHTML = aStr[index - 2]);
            } else if (index == 1) {
                index && (aSpan[index - 1].className = "active", aSpan[index - 1].innerHTML = aStr[index - 1]);
            }
        };
    });

    function checkStrong(sValue) {
        var modes = 0;
        if (sValue.length == 0)
            return 0;
        if (sValue.length < 6)
            return 1;
        if (/\d/.test(sValue))
            modes++;
        //数字
        if (/[a-z]/.test(sValue))
            modes++;
        //小写
        if (/[A-Z]/.test(sValue))
            modes++;
        //大写
        if (/\W/.test(sValue))
            modes++;
        //特殊字符
        switch (modes) {
            case 1:
                return 1;
                break;
            case 2:
                return 2;
            case 3:
            case 4:
                return sValue.length < 12 ? 3 : 4;
                break;
        }
    }

</script>
<style type="text/css">
    #tips {
        float: left;
    }

    #tips span {
        float: left;
        width: 50px;
        height: 30px;
        color: #fff;
        overflow: hidden;
        background: #ccc;
        margin-right: 3px;
        line-height: 30px;
        text-align: center;
    }

    #tips.s1 .active {
        background: #f30;
    }

    #tips.s2 .active {
        background: #fc0;
    }

    #tips.s3 .active {
        background: #cc0;
    }

    #tips.s4 .active {
        background: #090;
    }
</style>
